<template>
  <div class="home-container">
    <el-container>
      <el-header>
        <div class="header-left">
          <img src="../../assets/logo.png" />
          <span>杭州前端16期后台管理系统</span>
        </div>
        <el-button @click="logout">退出</el-button>
      </el-header>
      <el-container>
        <el-aside width="200px">
          <el-menu default-active="2"
                   class="el-menu-vertical-demo"
                   background-color="#373d41"
                   text-color="#fff"
                   active-text-color="#ffd04b">
            <el-submenu index="1">
              <template slot="title">
                <i class="el-icon-location"></i>
                <span>导航一</span>
              </template>
              <el-menu-item index="1-4-1">
                <i class="el-icon-location"></i>
                <span>导航一</span>
              </el-menu-item>
            </el-submenu>
          </el-menu>
        </el-aside>
        <el-main>Main</el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  data () {
    return {}
  },
  created () { },

  methods: {
    logout () {
      sessionStorage.removeItem('token')
      this.$router.push('/login')
    }
  }
}
</script>

<style scoped lang='less'>
.home-container {
  height: 100%;

  .el-container {
    height: 100%;

    .el-header {
      background-color: #374d41;
      display: flex;
      justify-content: space-between;
      align-items: center;

      .header-left {
        display: flex;
        align-items: center;

        img {
          height: 50px;
        }

        span {
          font-size: 26px;
          color: #fff;
          margin-left: 10px;
        }
      }
    }

    .el-aside {
      background-color: #373d41;
    }

    .el-main {
      background-color: #eee;
    }
  }
}

</style>
